const LOCAL_KEY = "todoList"
export function getTodoList() {
    let todoList = JSON.parse(localStorage.getItem(LOCAL_KEY));
    if (todoList) {
        return todoList
    }
    return []
}
export function setTodo(todos) {
    localStorage.setItem(LOCAL_KEY, JSON.stringify(todos))
}

// 随机生成id
export function generateId(){
    return Date.now() + Math.random().toString(16).substring(2,6)
}

// export function generateId(){
//     return Date.now() + Math.random().toString(16).substring(2,6)
// }

